package com.example.myservlet;

import cn.dev33.satoken.stp.StpUtil;
import com.example.anno.RequestMapping;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

@Slf4j
@RequestMapping("/logininfo")
public class SatokenTest2Servlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String loginId = (String)StpUtil.getLoginId();
        resp.getWriter().printf(loginId);
    }
}